<template>
  <div>
    <div class="card" v-for="item in vitaeData" :key="item.cid">
      <div class="flex-center">
        <div class="title">
          <img src="@/assets/img/resume.svg" class="title-icon">
          <span>{{item.job_name}}</span>
        </div>
        <div class="flex-center">
          <el-button @click="update(item.cid)" type="primary" round size="small">编辑</el-button>
          <el-button @click="del(item.cid)" type="danger" round size="small">删除</el-button>
        </div>
      </div>
    </div>
  </div>
</template>
<script setup>
// defineEmits触发父组件的方法
import {defineProps, defineEmits} from 'vue'
// 定义一个emits常量，用于存储事件名称
const emits = defineEmits(['updateVitae','delVitae'])
// 定义props属性
const props = defineProps({
  vitaeData:Array
})
const update = (cid) => {
  emits('updateVitae',cid)
}
const del = (cid) => {
  emits('delVitae',cid)
}
</script>
